﻿using System;

namespace School.Business
{
    using EDP.Authentication;
    using EDP.Common.Model;
    using EDP.Database;
    using EDP.Framework;
    using EDP.Framework.Utility;

    using School.Model;

    /// <summary>
    /// 业务处理基类
    /// </summary>
    public class BLLBase : ISecurityCertificate
    {
        /// <summary>
        /// 账号认证
        /// </summary>
        /// <param name="userIdentify"></param>
        /// <param name="verificationIdentify"></param>
        /// <param name="dbInstance"></param>
        /// <param name="loginMode"></param>
        /// <returns></returns>
        public ResultModel<LoginInfoModel> AccountAuthentication(string userIdentify, string verificationIdentify, IDBInstance dbInstance, LoginModeEnmu loginMode) {
            ResultModel<LoginInfoModel> ret = new ResultModel<LoginInfoModel>();

            //1.实现账号认证,并给LoginInfoModel赋值
            //2.在业务接口管理处添加ISecurityCertificate的管理,并指定该类为实现类

            return ret;
        }
    }

    /// <summary>
    /// 学生业务接口
    /// </summary>
    public interface IStudentBLL : InterfaceBase {
        /// <summary>
        /// 新增学生
        /// </summary>
        /// <param name="item"></param>
        /// <param name="db"></param>
        /// <returns></returns>
        ResultModel<bool> AddStudent(StudentModel item, IDBInstance db = null);
    }

    /// <summary>
    /// IStudentBLL接口实现类
    /// </summary>
    public class StudentBLLImplement : IStudentBLL
    {
        /// <summary>
        /// 新增学生
        /// </summary>
        /// <param name="item"></param>
        /// <param name="db"></param>
        /// <returns></returns>
        public ResultModel<bool> AddStudent(StudentModel item, IDBInstance db = null) {
            throw new NotImplementedException();
        }
    }

    /// <summary>
    /// 使用IStudentBLL接口
    /// </summary>
    public class UseIStudentBLL {
        IStudentBLL i_IStudentBLL = InterfaceFactory.Create<IStudentBLL>();
    }
}
